package necpu_2;

import java.util.Arrays;
import java.util.Scanner;

public class First {

	public static void main(String[] args) {
		Scanner scan=new Scanner(System.in);
		int n=scan.nextInt();
		int arr[]=new int[50];
		for(int i=0;i<n;i++) {
			arr[i]=scan.nextInt();
		}
		Arrays.sort(arr,0,n);
		double sum=0;
		for(int i=2;i<n-2;i++) {
			sum+=arr[i];
		}
		double score=sum/(n-4);
		System.out.printf("%.2f",score);

	}

}
